package com.gobang.domain.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 落子响应数据传输对象
 * 用于服务端返回落子处理结果
 * 
 * @author System
 * @since 1.0.0
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MoveResponseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 房间ID
     */
    private String roomId;

    /**
     * 操作是否成功
     */
    private Boolean success;

    /**
     * 落子信息
     */
    private MoveInfo move;

    /**
     * 游戏状态
     */
    private String gameStatus;

    /**
     * 获胜者ID
     */
    private Long winnerId;

    /**
     * 游戏是否结束
     */
    private Boolean isGameOver;

    /**
     * 下一轮次
     */
    private String nextTurn;

    /**
     * 错误消息
     */
    private String errorMessage;

    /**
     * 落子信息内部类
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class MoveInfo implements Serializable {

        private static final long serialVersionUID = 1L;

        /**
         * 落子行坐标
         */
        private Integer row;

        /**
         * 落子列坐标
         */
        private Integer col;

        /**
         * 棋子颜色
         */
        private String color;

        /**
         * 玩家信息
         */
        private PlayerInfo player;
    }

    /**
     * 玩家信息内部类
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PlayerInfo implements Serializable {

        private static final long serialVersionUID = 1L;

        /**
         * 玩家ID
         */
        private Long id;

        /**
         * 玩家用户名
         */
        private String username;
    }
} 